<template>
	<view class="">
			<view class="" style="height: 100vh;overflow: hidden;" v-if="bg" >
				<image v-if="bg" style="height: 100vh;width: 100%;" :src="bg" mode=""></image>
					<!-- <image class="leftAvatar" :src="indexInfo.avatar" mode=""></image> -->
					<!-- <image class="rightAvatar" :src="'https://yxcx.bigchun.com/'+indexInfo.qr_image" mode=""></image> -->
			</view>
			
	</view>
</template>

<script>
	import jssdk from '@/common/libs/jssdk';
	import share from '@/shopro/share/index.js'
	export default {
		props: {

		},
		data() {
			return {
			indexInfo:{},
			imgUrl:"",
			bg:"" 
			}
		},
		created() {
			this.imgUrl = window.location.href.split('/#/')[0]
			this.$api.post({
				url: '/user/index',
			
				success: (res) => {
					console.log(res)
					this.indexInfo = res
			
				}
			})
			this.$api.post({
				url: '/user/userCreatePoster',
			
				success: (res) => {
						
					if(res){
					
						this.bg = 'https://yxcx.bigchun.com'+res.substr(1)
					}
					
						
			
				}
			})
			this.setShare()
			
		},

		methods: {
			setShare() {
				let shareId = uni.getStorageSync('userInfo').id
				this.SpmResult = share.setShareInfo({
					title: '个人海报',
					desc: '',
					image: '',
					params: {
						page: 2,
						pageId: '',
						shareId: shareId
					}
				});
				 let link = window.location.href + '&isShare=true&userid=' + shareId + '&' + this.SpmResult.query
			
				
			
				jssdk.share({
					title: '个人海报',
					desc: '',
					// link:encodeURIComponent(link),
					link: link,
					imgUrl:this.indexInfo.avatar ,
					type: '2',
					id: this.id
				})
			},
		
		}

	}
</script>

<style lang="scss">
	.adContainer {
		position: fixed;
		top: 0;
		z-index: 99999;
		width: 536rpx;
		height: 300rpx;
		left: 0;
		right: 0;
		margin: auto;
		top: 180rpx;
	}

	#myVideos {
		width: 100%;
		height: 100%;
	}

	.adContainer {
		view {
			position: relative;
			width: 100%;
			height: 100%;
		}
	}

	.jump {
		position: absolute;
		right: 4px;
		top: 4px;
		width: 38px;
		height: 38px;
		z-index: 999;
	}

	.djs {
		position: absolute;
		left: 4px;
		top: 4px;
		font-size: 7px;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
		z-index: 999;
	}

	.adText {
		position: absolute;
		left: 4px;
		bottom: 4px;
		background: #333;
		color: #fff;
	}

	.buyNow {
		width: 204rpx;
		height: 50rpx;
		background: #1387FE;
		border-radius: 3px 3px 3px 3px;
		font-size: 26rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		text-align: center;
		line-height: 50rpx;
		position: absolute;
		left: 0;
		right: 0;
		margin: auto;
		bottom: 44rpx;
	}
	.leftAvatar{
		    position: absolute;
		    width: 260rpx;
		    height: 260rpx;
		    z-index: 999;
		    left: 100rpx;
		    top: 480rpx;
	}
		
	.rightAvatar{
		position: absolute;
		width: 260rpx;
		height: 260rpx;
		z-index: 999;
		right: 100rpx;
		top: 480rpx;
	}
</style>
